import { Component } from '@angular/core';
import { DownLoaderService } from './downloader.service';

@Component({
    selector: 'downloader',
    templateUrl: './downloader.component.html',
    providers: [
        DownLoaderService,
    ]
})

export class DownloaderComponent {
    contents: string;
    constructor(
        private downloaderService: DownLoaderService
    ) {}

    download() {
        this.downloaderService.getTextFile('assets/textfile.txt')
            .subscribe(results => this.contents = results);
    }
}
